package a.g;

import a.c.d;
import a.c.e;
import a.f.l.a.a;
import a.f.l.a.cb;
import a.f.l.a.mc;
import a.f.l.a.o;
import a.f.rc;
import a.h.cc;
import a.h.dc;
import a.h.z;
import a.i.p;
import a.j.g;

public class ab
  extends h
{
  private static final String q = "POLYLINE_EDGE_ROUTER";
  private static final String r = "LAYOUT";
  private static final String s = "SCOPE";
  private static final String t = "SCOPE_ALL_EDGES";
  private static final String u = "SCOPE_SELECTED_EDGES";
  private static final String v = "SCOPE_EDGES_AT_SELECTED_NODES";
  private static final String[] w = { "SCOPE_ALL_EDGES", "SCOPE_SELECTED_EDGES", "SCOPE_EDGES_AT_SELECTED_NODES" };
  private static final String x = "OPTIMIZATION_STRATEGY";
  private static final String y = "STRATEGY_BALANCED";
  private static final String z = "STRATEGY_MINIMIZE_BENDS";
  private static final String A = "STRATEGY_MINIMIZE_CROSSINGS";
  private static final String[] B = { "STRATEGY_BALANCED", "STRATEGY_MINIMIZE_BENDS", "STRATEGY_MINIMIZE_CROSSINGS" };
  private static final String C = "MONOTONIC_RESTRICTION";
  private static final String D = "MONOTONIC_NONE";
  private static final String E = "MONOTONIC_VERTICAL";
  private static final String F = "MONOTONIC_HORIZONTAL";
  private static final String G = "MONOTONIC_BOTH";
  private static final Object[] H = { "MONOTONIC_NONE", "MONOTONIC_HORIZONTAL", "MONOTONIC_VERTICAL", "MONOTONIC_BOTH" };
  private static final String I = "MINIMAL_DISTANCES";
  private static final String J = "MINIMAL_EDGE_TO_EDGE_DISTANCE";
  private static final String K = "MINIMAL_NODE_TO_EDGE_DISTANCE";
  private static final String L = "MINIMAL_NODE_CORNER_DISTANCE";
  private static final String M = "MINIMAL_FIRST_SEGMENT_LENGTH";
  private static final String N = "MINIMAL_LAST_SEGMENT_LENGTH";
  private static final String O = "GRID_SETTINGS";
  private static final String P = "GRID_ENABLED";
  private static final String Q = "GRID_SPACING";
  private static final String R = "CONSIDER_NODE_LABELS";
  private static final String S = "CONSIDER_EDGE_LABELS";
  private static final String T = "ENABLE_REROUTING";
  private static final String U = "MAXIMAL_DURATION";
  private static final String V = "POLYLINE_ROUTING";
  private static final String W = "ENABLE_POLYLINE_ROUTING";
  private static final String X = "PREFERRED_POLYLINE_SEGMENT_LENGTH";
  private a Y;
  public static int Z;
  
  public ab()
  {
    super("POLYLINE_EDGE_ROUTER", "yFiles Layout Team", "Polyline Edge Router");
    d(true);
  }
  
  public dc j()
  {
    int j = f.p;
    boolean bool = f.o;
    a locala = new a();
    o localo = locala.c();
    dc localdc = new dc(a());
    localdc.l("LAYOUT");
    int i = locala.h();
    if (j == 0)
    {
      if (i == 0)
      {
        localdc.a("SCOPE", w, 0);
        if (j != 0) {
          break label115;
        }
      }
    }
    else {
      if (!bool) {
        break label90;
      }
    }
    localdc.a("SCOPE", w, 1);
    label90:
    localdc.a("OPTIMIZATION_STRATEGY", B, 0);
    localdc.a("MONOTONIC_RESTRICTION", H, localo.e());
    label115:
    cc localcc = new cc();
    localcc.a("OptionGroup.title", "MINIMAL_DISTANCES");
    localcc.a(localdc.a("MINIMAL_EDGE_TO_EDGE_DISTANCE", localo.c()));
    localcc.a(localdc.a("MINIMAL_NODE_TO_EDGE_DISTANCE", locala.n()));
    localcc.a(localdc.a("MINIMAL_NODE_CORNER_DISTANCE", localo.d()));
    localcc.a(localdc.a("MINIMAL_FIRST_SEGMENT_LENGTH", localo.a()));
    localcc.a(localdc.a("MINIMAL_LAST_SEGMENT_LENGTH", localo.b()));
    localcc = new cc();
    localcc.a("OptionGroup.title", "GRID_SETTINGS");
    cb localcb = locala.m();
    if (j == 0)
    {
      if (localcb != null)
      {
        localcc.a(localdc.a("GRID_ENABLED", true));
        localcc.a(localdc.a("GRID_SPACING", localcb.c()));
        if (j != 0) {
          break label382;
        }
        if (!bool) {}
      }
      else
      {
        localcc.a(localdc.a("GRID_ENABLED", false));
      }
    }
    else {
      localcc.a(localdc.a("GRID_SPACING", 10.0D));
    }
    localdc.a("CONSIDER_NODE_LABELS", locala.k());
    localdc.a("CONSIDER_EDGE_LABELS", locala.l());
    localdc.a("ENABLE_REROUTING", locala.g());
    localdc.a("MAXIMAL_DURATION", 0);
    localdc.l("POLYLINE_ROUTING");
    localdc.a("ENABLE_POLYLINE_ROUTING", true);
    localdc.a("PREFERRED_POLYLINE_SEGMENT_LENGTH", locala.e());
    label382:
    z localz = new z(localdc);
    localz.a("GRID_ENABLED", Boolean.TRUE, "GRID_SPACING");
    localz.a("ENABLE_POLYLINE_ROUTING", Boolean.TRUE, "PREFERRED_POLYLINE_SEGMENT_LENGTH");
    return localdc;
  }
  
  protected void m()
  {
    int i = f.p;
    super.m();
    z();
    b(this.Y);
    g localg = e();
    dc localdc = i();
    if (i == 0) {
      if ("SCOPE_SELECTED_EDGES".equals(localdc.h("SCOPE"))) {
        localg.a(this.Y.j(), new p()
        {
          private final g val$graph;
          
          public boolean getBool(Object paramAnonymousObject)
          {
            return this.val$graph.v((d)paramAnonymousObject);
          }
        });
      }
    }
    if ((i != 0) || ((f.o) && ("SCOPE_EDGES_AT_SELECTED_NODES".equals(localdc.h("SCOPE"))))) {
      localg.a(this.Y.i(), new p()
      {
        private final g val$graph;
        
        public boolean getBool(Object paramAnonymousObject)
        {
          return this.val$graph.y((e)paramAnonymousObject);
        }
      });
    }
  }
  
  private void z()
  {
    if ((f.p != 0) || (this.Y == null)) {
      this.Y = new a();
    }
  }
  
  public void b(rc paramrc)
  {
    int j = f.p;
    boolean bool = f.o;
    if ((j != 0) || ((paramrc instanceof a)))
    {
      a locala = (a)paramrc;
      o localo = locala.c();
      dc localdc = i();
      String str1 = localdc.h("SCOPE");
      if (j == 0) {
        if ("SCOPE_EDGES_AT_SELECTED_NODES".equals(str1))
        {
          locala.a((byte)4);
          if ((j == 0) && (!bool)) {
            break label112;
          }
        }
      }
      if (j == 0)
      {
        if ("SCOPE_ALL_EDGES".equals(str1))
        {
          if (j != 0) {
            break label109;
          }
          locala.a((byte)0);
        }
      }
      else {
        if (!bool) {
          break label112;
        }
      }
      label109:
      locala.a((byte)2);
      label112:
      String str2 = localdc.h("OPTIMIZATION_STRATEGY");
      mc localmc = localo.f();
      if (j == 0) {
        if (str2.equals("STRATEGY_BALANCED"))
        {
          localmc.a(3);
          localmc.b(1);
          if ((j == 0) && (!bool)) {
            break label213;
          }
        }
      }
      if (j == 0)
      {
        if (str2.equals("STRATEGY_MINIMIZE_BENDS"))
        {
          localmc.a(3);
          localmc.b(0);
          if (j != 0) {
            break label207;
          }
        }
      }
      else {
        if (!bool) {
          break label213;
        }
      }
      localmc.a(3);
      label207:
      localmc.b(5);
      label213:
      String str3 = localdc.h("MONOTONIC_RESTRICTION");
      if (j == 0) {
        if (str3.equals("MONOTONIC_BOTH"))
        {
          localo.a((byte)3);
          if (j != 0) {
            break label384;
          }
          if (!bool) {
            break label317;
          }
        }
      }
      if (j == 0) {
        if (str3.equals("MONOTONIC_HORIZONTAL"))
        {
          localo.a((byte)2);
          if (j != 0) {
            break label384;
          }
          if (!bool) {
            break label317;
          }
        }
      }
      if (j == 0)
      {
        if (str3.equals("MONOTONIC_VERTICAL")) {
          localo.a((byte)1);
        }
      }
      else
      {
        if (j != 0) {
          break label384;
        }
        if (!bool) {
          break label317;
        }
      }
      localo.a((byte)0);
      label317:
      localo.c(localdc.f("MINIMAL_EDGE_TO_EDGE_DISTANCE"));
      if (j == 0)
      {
        locala.c(localdc.f("MINIMAL_NODE_TO_EDGE_DISTANCE"));
        localo.d(localdc.f("MINIMAL_NODE_CORNER_DISTANCE"));
        localo.a(localdc.f("MINIMAL_FIRST_SEGMENT_LENGTH"));
        localo.b(localdc.f("MINIMAL_LAST_SEGMENT_LENGTH"));
        if (localdc.g("GRID_ENABLED"))
        {
          label384:
          double d = localdc.f("GRID_SPACING");
          locala.a(new cb(0.0D, 0.0D, d));
          if (j != 0) {
            break label488;
          }
          if (!bool) {
            break label426;
          }
        }
      }
      locala.a(null);
      label426:
      locala.c(localdc.g("CONSIDER_NODE_LABELS"));
      locala.d(localdc.g("CONSIDER_EDGE_LABELS"));
      locala.b(localdc.g("ENABLE_REROUTING"));
      locala.a(localdc.g("ENABLE_POLYLINE_ROUTING"));
      locala.a(localdc.f("PREFERRED_POLYLINE_SEGMENT_LENGTH"));
      label488:
      int i = localdc.e("MAXIMAL_DURATION");
      if (j == 0) {
        if (i == 0)
        {
          locala.a(9223372036854775807L);
          if (j == 0) {
            if (!bool) {
              return;
            }
          }
        }
        else
        {
          locala.a(i * 1000);
        }
      }
      if (!bool) {}
    }
    else
    {
      throw new IllegalArgumentException("Argument must be of type y.layout.router.polyline.EdgeRouter");
    }
  }
  
  public void n()
  {
    a(this.Y);
  }
  
  protected void o()
  {
    int i = f.p;
    g localg = e();
    if (i == 0) {
      if (localg.c(this.Y.j()) != null) {
        localg.j(this.Y.j());
      }
    }
    if ((i != 0) || (localg.c(this.Y.i()) != null)) {
      localg.j(this.Y.i());
    }
    super.o();
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.g.ab
 * JD-Core Version:    0.7.0.1
 */